package study.cv.image.support.utils;

import java.awt.color.ColorSpace;
import java.awt.image.BufferedImage;
import java.awt.image.ColorConvertOp;

/**
 * 颜色空间
 */
public final class CSpaceUtils {

    private CSpaceUtils() {
    }

    public static BufferedImage toRGB(BufferedImage src) {
        ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_sRGB);
        ColorConvertOp op = new ColorConvertOp(cs, null);
        return op.filter(src, null);
    }
}
